package com.newlink.building.userinfo.mvp.model

import com.newlink.building.common_base.base.BaseModel
import com.newlink.building.common_base.http.Base_RetrofitHelper
import com.newlink.building.common_base.model.bean.DeviceListData
import com.newlink.building.common_base.model.bean.DeviceListRequest
import com.newlink.building.common_base.model.bean.FamilyListData
import com.newlink.building.common_base.model.bean.HttpResult
import com.newlink.building.userinfo.mvp.contract.Module_UserInfo_AuthParamContract
import io.reactivex.Observable

/**
 * @author wangyang
 * @date 2022/9/20
 * @description 我的——关于页面的Model
 */
class Module_UserInfo_AuthParamModel : BaseModel(), Module_UserInfo_AuthParamContract.Model {

    override fun getAvailableArea(request: DeviceListRequest): Observable<HttpResult<DeviceListData>> {
//        KcpTaskHelper.instance.requestDeviceList(request)
        return Base_RetrofitHelper.service.getDeviceList(
            request.accessToken,
            request.page,
            request.limit,
            request.devName,
            request.devType
        )
    }

    override fun getFamilyMembers(token: String): Observable<HttpResult<FamilyListData>> {
        return Base_RetrofitHelper.service.getFamilyManagementList(token, 1, 20)
    }


}